package net;

import java.util.concurrent.ConcurrentLinkedQueue;

public class ConcurrentQueue<T> {

    private ConcurrentLinkedQueue<T> concurrentLinkedQueue ;

    public ConcurrentQueue()
    {
        concurrentLinkedQueue = new ConcurrentLinkedQueue<>();
    }

    public T dequeue()
    {
        return concurrentLinkedQueue.poll();
    }

    public void enqueue(T t)
    {
        concurrentLinkedQueue.add(t);
    }

    public T peek()
    {
        return concurrentLinkedQueue.peek();
    }

    public int size()
    {
        return concurrentLinkedQueue.size();
    }

    public void remove(T t)
    {
        concurrentLinkedQueue.remove(t);
    }
}
